import request from '@/utils/request'
import { baseURL } from '@/config'

export function getList(params) {
  return request({
    url: '/admin/user/getList',
    method: 'get',
    params,
  })
}
export function getRescueList(params) {
  return request({
    url: '/admin/user/rescue/getList',
    method: 'get',
    params,
  })
}
export function doRescuedoEdit(data) {
  return request({
    url: '/admin/user/rescue/doEdit',
    method: 'post',
    data,
  })
}
export function doDelete(data) {
  return request({
    url: '/admin/user/doDelete',
    method: 'post',
    data,
  })
}
export function doExport(params) {
  let paramsStr = '?'
  let obj = params
  for (let key in obj) {
    paramsStr += key + '=' + obj[key] + '&'
  }
  window.location.href =
    baseURL + 'admin/user/doExport' + paramsStr.slice(0, paramsStr.length - 1)
}

export function doImport(data) {
  return request({
    url: '/admin/user/doImport',
    method: 'post',
    data,
  })
}
